Modern society is an information society. A user is able to receive and send information at any time and at any place, and is able to execute application programs with a handheld device. The results of the data interchange and the application program execution might need to be stored in the handheld device, and they might also need to be consistent with the data of the same type in other devices. That is, when the data in one device changes, it is desirable that the corresponding data in other devices is changed accordingly. This is called data synchronization (DS).
A so-called “fingerprint” method is used in the DS technology. A fingerprint is a value obtained from a set of data processed through a certain algorithm Any change of the data result in a change in its fingerprint, and thus fingerprints can effectively identify the change of data. From a single data element to a database, corresponding fingerprint(s) may be generated. One application of the fingerprints is that, for example, a server may use them to determine whether the data received from a terminal is the same as the data stored on the server itself. No matter whether it's the data on the server or the data on the terminal that has changed, the fingerprints of the data would be different. If a received fingerprint is the same as the stored fingerprint, the data on the server and on the terminal are the same, and, in some cases, the terminal does not need to send the data to the server. If the fingerprints are different, the data has changed. At this time, a collision detection strategy is applied to solve the conflict. If the data on the server is to be based on, then the terminal does not need to send the changed data. Thus, by comparing the fingerprints, some unnecessary data transmission can be avoided, and therefore, the traffic load of the server-terminal communication link can be reduced. In addition, fingerprints may also be used in other applications such as resumable downloading.
Various algorithms may be adopted for fingerprint calculations. An algorithm negotiation is needed to make both of the communicating parties use the same algorithm. In the negotiation, one party sends a set of supported algorithms to the other party, and the other party finds the supported fingerprint algorithm within the set and notifies the peer party, thus completing the algorithm negotiation. A currently used DS flow that employs the fingerprint technology is shown in FIG. 1.
1) A negotiation between the server and the client over the fingerprint use manner is included in PKG (package) 1 and PKG 2.
2) The identifier (ID) and the fingerprint of the data are sent from the client to the server in PKG 3.
3) After receiving the PKG 3, the server compares the fingerprint with a corresponding fingerprint it stores, and indicates to the client in PKG 4 an identification of a data element that needs to be sent by the client.
4) After receiving the PKG 4, the client sends the required data element via PKG 5 according to the instructions of the server.
5) After receiving the PKG 5, the server returns information about a receiving state via PKG 6, and optionally sends the data changed by the server.
In the conception of the present invention, the inventors found that the existing fingerprint technology has the following drawbacks.
The purpose of using the fingerprints is to replace a long data element with a short fingerprint, therefore reducing the amount of data bits to be transmitted. However, it is found that some fingerprints obtained through certain algorithms are actually longer than the corresponding data elements, rendering the fingerprint calculation and transmission meaningless. In that case, if the fingerprints are calculated and sent instead of the data, the calculation load of the device (especially a client device) would increase unnecessarily. Moreover, an additional interaction between the client and the server may occur for certain data, thus wasting air interface resources. Currently, no solution has been proposed to overcome the above drawbacks.